<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{socio.TituloDetalles}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form enctype="multipart/form-data">
                <p:panel header="Modificación del Socio" >                
                    <table border="0" style="font-size: small">
                        <h:inputHidden value="#{socioController.selected.id}"/>                                                
                        <h:inputHidden value="#{socioController.selected.ruc}"/>
                        <tr>
                            <th align="right" scope="row">
                                <p:outputLabel for="txtRuc" value="#{socio.RUC}"/>                                
                            </th>
                            <td align="left">
                                <p:inputText readonly="true" id="txtRuc" value="#{socioController.selected.ruc}" title="#{socio.RUC}" required="true" requiredMessage="#{socio.CampoRUC}" size="35"/>
                            </td>
                            <td width="210" height="260" bgcolor="black" rowspan="7" align="center" valign="middle">
                                <p:graphicImage width="200" height="250" value="#{socioController.image}">
                                    <f:param name="socioId" value="#{socioController.selected.id}" />
                                </p:graphicImage>
                            </td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">
                                <p:outputLabel for="txtNombres" value="#{socio.Nombres}"/>
                            </th>
                            <td width="203">
                                <p:inputText id="txtNombres" value="#{socioController.selected.nombres}" title="#{socio.Nombres}" required="true" requiredMessage="#{socio.CampoNombres}" size="35"/>
                            </td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">
                                <p:outputLabel for="txtApellidos" value="#{socio.Apellidos}"/>
                            </th>
                            <td width="203">
                                <p:inputText id="txtApellidos" value="#{socioController.selected.apellidos}" title="#{socio.Apellidos}" required="true" requiredMessage="#{socio.CampoApellidos}" size="35"/>
                            </td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">Dirección:</th>
                            <td width="203"><p:inputText id="txtDireccion" size="35" value="#{socioController.selected.direccion}" ></p:inputText></td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">Teléfono:</th>
                            <td width="203"><p:inputText id="txtTelefono" size="35" value="#{socioController.selected.telefono}" ></p:inputText></td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">Email:</th>
                            <td width="203"><p:inputText id="txtCorreo" size="35" value="#{socioController.selected.email}" ></p:inputText></td>
                        </tr>
                        <tr>
                            <th align="right" scope="row">Estado:</th>
                            <td><p:selectBooleanCheckbox value="#{socioController.selected.estado}"/></td>                                                   
                        </tr>    
                        <tr>                           
                            <th align="right" scope="row">#{socio.Foto}</th>
                            <td align="left">
                                <p:fileUpload value="#{socioController.selected.file}" mode="simple" />
                            </td>                        
                            <td align="center"><strong>Fotografía</strong></td>
                        </tr>
                        <tr>                                
                            <th align="center" colspan="2" scope="row">
                                <p:commandButton ajax="false" action="#{socioController.modificarSocio()}" value="#{socio.Modificar}"/>
                            </th>
                        </tr>  
                    </table> 
                    <div style="font-size: small" align="right">
                        * Campos Obligatorios
                    </div>
                    <div align="left" style=" font-size: small">
                        <p:commandLink ajax="false" action="#{socioController.cargarDetalleModificarSocio(socioController.selected.id)}" 
                                       value="#{socio.Detalle}"
                                       rendered="#{accionController.getAccionByVista('Socio', 'Ver')}"/>
                        <br />
                        <h:link outcome="index" value="#{socio.RegresarIndex}"/>
                    </div> 
                </p:panel>      
            </h:form>
        </ui:define>
    </ui:composition>

</html>

